<html xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui" >  

    <!--    <h:body>-->
    <ui:composition template="layout.xhtml">
        <ui:define name="corpo">
            <h:form id="index_funcionario" acceptcharset="utf-8"> 
                 <p:panel>     
                    <br/>
                    <h:panelGrid style="float: right;" columns="4">
                        <p:graphicImage url="/media/img/new.png"/> <p:commandLink value="Cadastrar" action="#{managerFunc.criarFuncionario()}" update="@form"/>
                    </h:panelGrid>
                    <br/>
                    <br/>
                    <p:dataTable id="funcTable" var="func" value="#{managerFunc.listarFuncionario()}" >  
                        <f:facet name="header">  
                            Ultimos Funcionarios Cadastrados
                        </f:facet>
                        <p:column >  
                            <f:facet name="header" >   
                                Nome   
                            </f:facet>  
                            <h:outputText value="#{func.nome}" />  
                        </p:column>
                         <p:column style="width:300px;">  
                            <f:facet name="header" >   
                                Chave de Acesso   
                            </f:facet>  
                             <h:outputText value="#{func.chaveAcesso}" />  
                        </p:column>
                        <p:column style="width:90px;" headerText="Opções">  

                            <p:commandButton  icon="editar" actionListener="#{managerFunc.editarFuncionario(func)}" update="@form" />

                        </p:column>    
                    </p:dataTable> 

                </p:panel>
               
            </h:form>
        </ui:define>
    </ui:composition>
</html>